/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
// -*- coding:iso-8859-15 mode: c++ -*-
/** 
 * \file
 * \brief MaCI_SpeedCtrl Logger header.
 * \author Matthieu Myrsky <matthieu.myrsky@tkk.fi>
 *
 * $Id: SpeedCtrlLogger.hpp,v 1.3 2009-06-12 12:49:23 morsko Exp $
 *
 */
#ifndef _SPEEDCTRLLOGGER_HPP_
#define _SPEEDCTRLLOGGER_HPP_
#include <string>
#include <vector>
#include "Logger.hpp"
#include "owndebug.h"
#include "ownutils.h"
#include "SpeedCtrlClient.hpp"

class SpeedCtrlLogger: private gim::CSync, 
                       private gim::CThread,
                       public Logger

{
public:

  /**
   * Constructor
   * 
   * @param 
   */
  SpeedCtrlLogger(MaCI::SpeedCtrl::CSpeedCtrlClient *aClient,
                 std::string aMaCISLName);
   

  /**
   * Destructor
   */
  virtual ~SpeedCtrlLogger();

  /**
   * Starts logging selected type(s)
   *
   * @return      True if logging started, else false
   */
  bool StartLogging(void);

  /**
   * Stops logging selected type(s)
   *
   * @return      True if logging started, else false
   */
  bool StopLogging(void);

  std::string GetName(void);

  bool GetAdditionalInformation(std::string &aInformation);
private:
  MaCI::SpeedCtrl::CSpeedCtrlClient *iSClient;
  bool iRunning;
  bool iRunningThreadStopped;
  FILE *iFile;
  std::string iMaCISLName;
  std::string iAdditionalInformation;
  int ThreadFunction(const int aThreadNumber);
  SpeedCtrlLogger(const SpeedCtrlLogger&):
    CSync(1, 1),               
    CThread(1),                
    Logger(),
    iSClient(NULL),
    iRunning(false),
    iRunningThreadStopped(true),
    iFile(NULL),
    iMaCISLName(""),
    iAdditionalInformation("")
  {}

  SpeedCtrlLogger &operator=(const SpeedCtrlLogger&){return *this;}
 
};
#endif
